import argparse
import os
from cam_reader import readPklSceneInfo, save_to_txt

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='Data converter arg parser')
    parser.add_argument(
        '--load_dir',
        type=str,
        required=True,
        help='the root path of dataset: load_dir/scanxx/sparse/0/...')
    parser.add_argument(
        '--save_dir',
        type=str,
        required=True,
        help='the save path of result: save_dir/sacnxx/...txt')
    parser.add_argument(
        '--debug_mode',
        action='store_true',
        default=False,
        help='to judge whether it is in the debug mode.')
    args = parser.parse_args()
    
    # for scene in scene_list:
    cam_infos = readPklSceneInfo(args.load_dir)
    save_to_txt(cam_infos, args.save_dir)
    # cam_infos = readColmapSceneInfo(args.load_dir)
    # save_to_txt(cam_infos, args.save_dir)

# python cam_pose_utils/main.py --load_dir /workspace/data/blender/traj/mip_bicycle --save_dir /workspace/data/blender/cam_pose/mip_bicycle
# python cam_pose_utils/main.py --load_dir /workspace/data/blender/traj/mip_garden --save_dir /workspace/data/blender/cam_pose/mip_garden
# python cam_pose_utils/main.py --load_dir /workspace/data/blender/traj/dtu_24 --save_dir /workspace/data/blender/cam_pose/dtu_24

